package www.bplead.com.mydemo.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import www.bplead.com.mydemo.R;
import www.bplead.com.mydemo.uploader.activity.UploaderActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{

    Button layoutViewPagerBtn;
    Button layoutViewDrawerBtn;
    Button loadImageBtn;
    Button listViewBtn;
    Button customDialogBtn;
    Button customView01Btn;
    Button scrollDeleteBtn;
    Button qrcodePrintBtn;
    Button imageUploadBtn;
    Button imageUploadBtn2;
    Button dataUpdateBtn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        layoutViewPagerBtn = (Button) this.findViewById(R.id.btn_layout_viewpager);
        layoutViewDrawerBtn = (Button) this.findViewById(R.id.btn_layout_drawer);
        loadImageBtn = (Button) this.findViewById(R.id.btn_image_loader);
        listViewBtn = (Button) this.findViewById(R.id.btn_listview_scroll);
        customDialogBtn = (Button) this.findViewById(R.id.btn_dialog_custom);
        customView01Btn = (Button) this.findViewById(R.id.btn_custom_view01);
        scrollDeleteBtn = (Button) this.findViewById(R.id.btn_scroll_delete);
        qrcodePrintBtn = (Button) this.findViewById(R.id.btn_qrcode_print);
        imageUploadBtn = (Button) this.findViewById(R.id.btn_image_upload);
        imageUploadBtn2 = (Button) this.findViewById(R.id.btn_image_upload2);
        dataUpdateBtn = (Button) this.findViewById(R.id.btn_data_update);

        layoutViewPagerBtn.setOnClickListener(this);
        layoutViewDrawerBtn.setOnClickListener(this);
        loadImageBtn.setOnClickListener(this);
        listViewBtn.setOnClickListener(this);
        customView01Btn.setOnClickListener(this);
        imageUploadBtn2.setOnClickListener(this);
        dataUpdateBtn.setOnClickListener(this);

        customDialogBtn.setOnClickListener(this);
        scrollDeleteBtn.setOnClickListener(this);
        qrcodePrintBtn.setOnClickListener(this);
        imageUploadBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            //ViewPager+Fragement主界面布局
            case R.id.btn_layout_viewpager:
                Intent intent1 = new Intent(this,LayoutViewPagerActivity.class);
                startActivity(intent1);
                break;
            //DrawerLayout+NavigationView主界面布局
            case R.id.btn_layout_drawer:
                Intent intent2 = new Intent(this,LayoutViewDrawerActivity.class);
                startActivity(intent2);
                break;
            //UniversalImageLoader图片加载
            case R.id.btn_image_loader:
                Intent intent3 = new Intent(this,LoadImageActivity.class);
                startActivity(intent3);
                break;
            //ListView_上拉刷新下拉加载更多
            case R.id.btn_listview_scroll:
                Intent intent4 = new Intent(this,ListViewScrollActivity.class);
                startActivity(intent4);
                break;
            //自定义对话框
            case R.id.btn_dialog_custom:
                Intent intent5 = new Intent(this,CustomDialogActivity.class);
                startActivity(intent5);
                break;
            //自定义对话框
            case R.id.btn_custom_view01:
                Intent intent6 = new Intent(this,CustomView01Activity.class);
                startActivity(intent6);
                break;
            //滑动删除
            case R.id.btn_scroll_delete:
                Intent intent7 = new Intent(this,ScrollDeleteActivity.class);
                startActivity(intent7);
                break;
            //蓝牙打印机
            case R.id.btn_qrcode_print:
                Intent intent8 = new Intent(this,BluetoothPrinterActivity.class);
                startActivity(intent8);
                break;
            //拍照或者从相册获取图片并上传
            case R.id.btn_image_upload:
                Intent intent9 = new Intent(this,UploadImageActivity.class);
                startActivity(intent9);
                break;
            //拍照或者从相册获取图片并上传2
            case R.id.btn_image_upload2:
                Intent intent10 = new Intent(this,UploaderActivity.class);
                startActivity(intent10);
                break;
            //使用sqlite进行增删改查
            case R.id.btn_data_update:
                Intent intent11 = new Intent(this,StudentListActivity.class);
                startActivity(intent11);
                break;
        }
    }
}
